#include "EditorAbilityViewModel.h"
#include "Object/NewObject.h"

#include "Framework/Editor.h"
#include "EditorAbilityModel.h"

void REditorAbilityViewModel::BindModel(TSharedObjectPtr<REditorAbilityModel> InModel)
{
    BaseModel = InModel;
}

float REditorAbilityViewModel::GetWidth() const
{
    if(BaseModel->bIsExpanded)
    {
        return BaseModel->Width;
    }
    else
    {
        return 0.0f;
    }

}

void REditorAbilityViewModel::SetWidth(float InWidth)
{
    BaseModel->Width = InWidth;
}

float REditorAbilityViewModel::GetHeight() const
{
    if(BaseModel->bIsExpanded)
    {
        return BaseModel->Height;
    }
    else
    {
        return 0.0f;
    }
}

void REditorAbilityViewModel::SetHeight(float InHeight)
{
    BaseModel->Height = InHeight;
}

bool REditorAbilityViewModel::IsExpanded() const
{
    return BaseModel->bIsExpanded;
}

void REditorAbilityViewModel::ToggleIsExpanded()
{
    BaseModel->bIsExpanded = !BaseModel->bIsExpanded;
}

CString REditorAbilityViewModel::GetName() const
{
    return BaseModel->GetName();
}

TSharedObjectPtr<REditorAbilityModel> REditorAbilityViewModel::GetBaseModel()
{
    return BaseModel;
}
